package com.saydc.model;

import java.io.Serializable;
import java.util.List;

import com.saydc.dao.ExpertiseDAO;

public class Expertise implements Serializable{

	private static final long serialVersionUID = 1L;
	public static final int TRAINEE = 1;
	public static final int JUNIOR = 2;
	public static final int SEMISENIOR = 3;
	public static final int SENIOR = 4;
	
	private int idExpertise;
	private String descripcion;
	
	public Expertise(){
	}
	
	public Expertise(int idExpertise, String descripcion){
		super();
		this.idExpertise = idExpertise;
		this.descripcion = descripcion;
	}
	
	public int getIdExpertise() {
		return idExpertise;
	}
	public void setIdExpertise(int idExpertise) {
		this.idExpertise = idExpertise;
	}
	public String getDescripcion() {
		return descripcion;
	}
	public void setDescripcion(String descripcion) {
		this.descripcion = descripcion;
	}
	
	public static Expertise getTipoExpertise(int codigo){
    	ExpertiseDAO dao = ExpertiseDAO.getInstance();
    	List<Expertise> tiposExpertises = dao.getExpertises();
    	for(Expertise expertise : tiposExpertises){
    		if(expertise.getIdExpertise()==codigo){
    			return expertise;
    		}
    	}
    	return null;
    }
	
}
